#ifndef __ringBuff_h
#define __ringBuff_h



#define RING_BUFF_SIZE 50


typedef struct ringBuff{
    unsigned int in;               //写入的位置
    unsigned int out;              //读出的位置
    unsigned char buffer[RING_BUFF_SIZE];     //数据域
}stRingBuff;


//是否满
unsigned char IsRingBufferFull(stRingBuff *ringBuf);
//是否空
unsigned char IsRingBufferEmpty(stRingBuff *ringBuf);
//写一个字节
unsigned char WriteOneByteToRingBuffer(stRingBuff *ringBuf,char d);
//读一个字节
unsigned char ReadOneByteFromRingBuffer(stRingBuff *ringBuf,char *d);
void WriteRingBuffer(stRingBuff *ringBuf, char *writeBuf,unsigned int len);
//读len个
void ReadRingBuffer(stRingBuff *ringBuf,char *readBuf,unsigned int len);
//查长度
unsigned int GetRingBufferLength(stRingBuff *ringbuf);



#endif
